#ifndef _SCENE_INITIALISER_H
#define _SCENE_INITIALISER_H
#include <d3d11.h>
#include <d3dcompiler.h>
#include "SceneStructure.h"
#include "DX11Structure.h"
#include "Optional.h"
#include "DataLoader.h"
#include "ColoredVertex.h"
#include "WindowOperations.h"

class SceneInitialiser {

private:
	SceneStructure *sceneStructure;
	DX11Structure *dx11Structure;

	DataLoader *dataLoader;

public:
	SceneInitialiser(DataLoader *pDataLoader, DX11Structure *pDX11Stucture);
	~SceneInitialiser() {}

	Optional<SceneStructure> initScene();

private:
	void initWorld();
	void initVertices();

	void compileShaders();
	void compileShader(wstring pShaderFileName, string pShaderEntryPoint, ID3DBlob **pShaderBuffer);

	void createVertexShaders();
	void createVertexShader(ID3DBlob *pShaderBuffer, ID3D11VertexShader **pShader);
	void createPixelShaders();
	void createPixelShader(ID3DBlob *pShaderBuffer, ID3D11PixelShader **pShader);

	void createVertexBuffers();
	void createVertexBuffer(size_t pVertexByteWidth, void *pVertexData, ID3D11Buffer **pVertexBuffer);

	void createIndexBuffers();
	void createIndexBuffer(int pIndexCount, DWORD *pIndices, ID3D11Buffer **pIndexBuffer);

	void createConstantBuffers();

	void createInputLayouts();

	void createAndSetViewport();
	void initCamera();
	void createWireFrame();

	void createShaderResources();

	void prepareData();
	
};

#endif
